package com.xyy.saas.payment.cores.enums;

import lombok.Getter;

/**
 * @author liujf
 */
@Getter
public enum YesNoEnum {
    YES(1, "是"),
    No(0, "否"),
    ;
    private Integer code;

    private String name;

    YesNoEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        if (YES.code.equals(code)) {
            return YES.name;
        } else if (No.code.equals(code)) {
            return No.name;
        } else {
            return null;
        }
    }

}

